<template>
	<view class="layoutWrap">
		<view class="grayBox"></view>
		<view class="wrap">
			<view class="artInfo">
				<text class="tit" v-text="detail.title || ''"></text>
				<view class="artTime">
					<text v-text="detail.auditDate || ''"></text>
				</view>
				<text class="con" v-text="detail.content || ''"></text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		dictCode
	} from '../../libs/common.js';
	export default {
		data() {
			return {
				detail: '',
				isRead: false,
				item: '',
				readNum: ''
			};
		},
		onLoad(option) {
			this.item = JSON.parse(option.data);
			this.getDetail(this.item);
			this.updateReadStatus(this.item);
		},
		methods: {
			//获取通知详情
			async getDetail(item) {
				let resp = await this.$http.get({
					url: `/oa/sysMessage/detail?auditNo=${item.auditNo}&auditType=${item.auditType}`,
				});
				this.detail = resp.result;
				// dictCode('dict_yes_no',this.detail.isRead)
			},
			//更新阅读状态
			updateReadStatus(item) {
				this.$http.get({
					url: `/oa/sysMessage/changeReadStatus?auditNo=${item.auditNo}&auditType=${item.auditType}`,
				});
			},
		}
	};
</script>

<style lang="scss" scoped>
	.artInfo {
		.tit {
			font-size: 44upx;
			font-family: Source Han Sans CN;
			font-weight: bold;
			color: rgba(51, 51, 51, 1);
			line-height: 60upx;
			padding-bottom: 40upx;
			display: block;
			text-align: center;
		}

		.con {
			font-size: 32upx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: rgba(51, 51, 51, 1);
			margin-top: 60upx;
			display: block;
		}
	}

	.artTime {
		display: flex;
		align-items: center;
		font-size: 26upx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);

		text {
			margin-right: 20upx;

			&:nth-of-type(3) {
				margin-left: auto;
				color: #3c68e5;
			}
		}

		navigator {
			margin-left: auto;
			color: #3c68e5;
		}
	}

	.grayBox {
		width: 100%;
		height: 20upx;
		background: #f2f4f5;
	}

	.wrap {
		padding: 40upx;
	}

	.layoutWrap {
		position: relative;
		min-height: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
	}

	.download {
		border-top: 1upx solid #ddd;
		border-bottom: 1upx solid #ddd;
		padding: 30upx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: auto;
		margin-bottom:30upx;
		.file {
			width: 44upx;
			height: 53upx;
		}

		.fileInfo {
			width: 410upx;

			text {
				display: block;

				&:nth-of-type(1) {
					font-size: 28upx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: rgba(51, 51, 51, 1);
				}

				&:nth-of-type(2) {
					font-size: 22upx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: rgba(51, 51, 51, 1);
				}
			}
		}

		.load {
			font-size: 26upx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: rgba(60, 104, 229, 1);

			image {
				width: 27upx;
				height: 26upx;
			}
		}
	}
	.submitButtonActive{
		margin-top: auto;
		margin-bottom: 20upx;
	}
</style>
